---

#
# This is the role for geoip-city-wsgi.
#
# install python-paste-deploy
- name: install python-paste-deploy
  package: name=python-paste-deploy state=present
  tags:
  - packages
  - geoip-city-wsgi
  - geoip-city-wsgi/app

- name: install GeoIP-data
  package: name=GeoIP-data state=present
  tags:
  - packages
  - geoip-city-wsgi
  - geoip-city-wsgi/app

- name: link the data file to the one we use
  file: state=link dest=/usr/share/GeoIP/GeoIPCity.dat src=/usr/share/GeoIP/GeoLiteCity.dat

- name: install geoip-city-wsgi.conf file
  copy: >
        src="geoip-city-wsgi.conf"
        dest="/etc/httpd/conf.d/geoip-city-wsgi.conf"
        owner=root
        group=root
        mode=0644
  notify:
  - reload httpd
  tags:
  - geoip_config
  - config
  - geoip-city-wsgi
  - geoip-city-wsgi/app

- name: setup /usr/share/geoip-city-wsgi directory
  file: >
        path=/usr/share/geoip-city-wsgi
        owner=root
        group=root
        mode=0755
        state=directory
  tags:
  - geoip_config
  - config
  - geoip-city-wsgi
  - geoip-city-wsgi/app

- name: install geoip-city.wsgi file
  copy: >
        src="geoip-city.wsgi"
        dest="/usr/share/geoip-city-wsgi/geoip-city.wsgi"
        owner=root
        group=root
        mode=0775
  notify:
  - reload httpd
  tags:
  - geoip_config
  - config
  - geoip-city-wsgi
  - geoip-city-wsgi/app
